/**
 * 招聘管理字典
 * 路由映射不同的接口，为了不影响 history.config ，单独维护一套招聘管理的字典
 * code:true 临时处理我的招聘页面的权限
 * isUser 用人部门
 * isHR HR部门
 * fetchType 接口类型： fetchRecruitInfo 职位信息.....
 * ModalFetch 列表页直接操作 招聘进度
 */
const pathNameMap = [
    // 列表页
    {
        pathName: '/office/personnelManagement/recruit/position',
        remark: '职位管理',
        requestUrl: '/api/oa/v1/recruit/getcompanylist',
        code: false,
        isUser: false,
        isHR: false,
        ModalFetch: '/api/oa/v1/recruit/querycompanyrecruitschdule',
        ModalUpdate: '/api/oa/v1/recruit/companyupdaterecruit'
    },
    {
        pathName: '/personal/portal/recruit/task',
        remark: '我的招聘任务',
        requestUrl: '/api/oa/v1/recruit/getmylist',
        code: true,
        isUser: false,
        isHR: true, // HR必传
        ModalFetch: '/api/oa/v1/recruit/queryrecruitschdule',
        ModalUpdate: '/api/oa/v1/recruit/updaterecruit'
    },
    {
        pathName: '/personal/portal/recruit/demand',
        remark: '我的招聘需求',
        requestUrl: '/api/oa/v1/recruit/getcreatlist',
        code: true,
        isHR: false,
        isUser: true // 用人部门userCode必填
    },
    // 招聘详情-我的招聘任务
    {
        pathName: '/personal/portal/recruit/task/positiondetails',
        remark: '我的招聘任务详情-职位信息',
        requestUrl: '/api/oa/v1/recruit/queryrecruit',
        code: true,
        fetchType: 'fetchRecruitInfo',
        isUser: false,
        isHR: true // HR必传
    },
    {
        pathName: '/personal/portal/recruit/task/positiondetails',
        remark: '我的招聘任务详情-候选人要求',
        requestUrl: '/api/oa/v1/recruit/queryrecruitclaim',
        code: true,
        fetchType: 'fetchCandidateClaim',
        isUser: false,
        isHR: true // HR必传
    },
    {
        pathName: '/personal/portal/recruit/task/positiondetails',
        remark: '我的招聘任务详情-招聘进度',
        requestUrl: '/api/oa/v1/recruit/queryrecruitschdule',
        code: true,
        fetchType: 'fetchRecruitSchedule',
        isUser: false,
        isHR: true // HR必传
    },
    // 招聘详情-我的招聘需求
    {
        pathName: '/personal/portal/recruit/demand/positiondetails',
        remark: '招聘需求-用人部门职位信息',
        requestUrl: '/api/oa/v1/recruit/querycreaterecruit',
        code: true,
        fetchType: 'fetchRecruitInfo',
        isHR: false,
        isUser: true // 用人部门userCode必填
    },
    {
        pathName: '/personal/portal/recruit/demand/positiondetails',
        remark: '招聘需求-用人部门候选人要求',
        requestUrl: '/api/oa/v1/recruit/querycreateclaim',
        code: true,
        fetchType: 'fetchCandidateClaim',
        isHR: false,
        isUser: true // 用人部门userCode必填
    },
    {
        pathName: '/personal/portal/recruit/demand/positiondetails',
        remark: '我的招聘任务详情-招聘进度',
        requestUrl: '/api/oa/v1/recruit/querycreateschdule',
        code: true,
        fetchType: 'fetchRecruitSchedule',
        isHR: false,
        isUser: true // 用人部门userCode必填
    },

    // 招聘详情-企业招聘详情
    {
        pathName: '/office/personnelManagement/recruit/position/positiondetails',
        remark: '企业招聘详情-职位信息',
        requestUrl: '/api/oa/v1/recruit/querycompanyrecruit',
        code: '',
        fetchType: 'fetchRecruitInfo',
        isUser: false,
        isHR: false
    },
    {
        pathName: '/office/personnelManagement/recruit/position/positiondetails',
        remark: '企业招聘详情-候选人要求',
        requestUrl: '/api/oa/v1/recruit/querycompanyrecruitclaim',
        code: '',
        fetchType: 'fetchCandidateClaim',
        isUser: false,
        isHR: false
    },
    {
        pathName: '/office/personnelManagement/recruit/position/positiondetails',
        remark: '企业招聘详情-招聘进度',
        requestUrl: '/api/oa/v1/recruit/querycompanyrecruitschdule',
        code: '',
        fetchType: 'fetchRecruitSchedule',
        isUser: false,
        isHR: false
    },

    // 我的招聘任务编辑
    {
        pathName: '/personal/portal/recruit/task/positiondetails',
        remark: '我的招聘任务编辑',
        requestUrl: '/api/oa/v1/recruit/updaterecruit',
        code: '',
        fetchType: 'updateRecruit',
        isUser: false,
        isHR: true // HR必传
    },
    // 企业招聘需求编辑
    {
        pathName: '/office/personnelManagement/recruit/position/positiondetails',
        remark: '企业招聘需求编辑',
        requestUrl: '/api/oa/v1/recruit/companyupdaterecruit',
        code: '',
        fetchType: 'updateRecruit',
        isUser: false,
        isHR: false
    }
];
const findUser = pathname => pathNameMap.find(v => v.pathName === pathname) || {};
export { pathNameMap, findUser };
